package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.sc.nft.entity.vo.TicketCradVO;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.UserSalvageEventsCardRecords;
import com.sc.nft.mapper.UserSalvageEventsCardRecordsMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * (sc_user_salvage_events_card_records)数据DAO
 *
 * @author Sun
 * @since 2024-08-06 18:39:14
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@Repository
public class UserSalvageEventsCardRecordsDao extends ServiceImpl<UserSalvageEventsCardRecordsMapper, UserSalvageEventsCardRecords> {

    public List<TicketCradVO> getListByUserRecordId(Long userRecordsId) {
        return baseMapper.getListByUserRecordId(userRecordsId);
    }

    public Integer getCountByCardNo(String cardNo) {
        LambdaQueryWrapper<UserSalvageEventsCardRecords> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(UserSalvageEventsCardRecords::getCardNo,cardNo);
        return count(wrapper);
    }
}